<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script type="text/javascript">
    //assign() 方法可加载一个新的文档。
    function newDoc() {
        window.location.assign("http://www.baidu.com")
    }
</script>
</head>
<body>
    <input type="button" value="Load new document" onclick="newDoc()"/>
</body>
</html>